ccR.Use = {
	Item =
	function(name) 
		if tonumber(name) ~= nil then name = GetItemInfo(name) end
		local isUsable = IsUsableItem(name)
		local startTime, duration, enable = GetItemCooldown(name)
		if GetItemCount(name) > 0 
		and duration == 0
		and isUsable
		then
			UseItemByName(name) 
		end
	end,
	Racials =
	function()
		if not IsMounted()
		and not ccR.Player.Is.CastingOrChanneling()
		and ccR.Player.Is.In.Combat()
		then
			if ccR.Player.Race() == "Blood Elf" and ccR.Var("Use_Arcane_Torrent") then ccR.Racial.Arcane_Torrent() end
			if ccR.Player.Race() == "Tauren" and ccR.Var("Use_Warstomp") then ccR.Racial.Warstomp(ccR.Var("Warstomp_Count")) end
			if ccR.Player.Race() == "Pandaren" and ccR.Var("Use_Quaking_Palm") then ccR.Racial.Quaking_Palm() end
			if ccR.Player.Race() == "Draenei" and ccR.Var("Use_Gift_of_the_Naaru") then ccR.Racial.Gift_of_the_Naaru(ccR.Var("Gift_of_the_Naaru_Count")) end
			if ccR.Player.Race() == "Dwarf" and ccR.Var("Use_Stoneform") then ccR.Racial.Stone_Form() end
			if ccR.Player.Race() == "Gnome" and ccR.Var("Use_Escape_Artist") then ccR.Racial.Escape_Artist() end
			if ccR.Player.Race() == "Human" and ccR.Var("Use_Every_man_for_Himself") then ccR.Racial.Every_Man_For_Himself() end
			if ccR.Player.Race() == "Undead" and ccR.Var("Use_Will_of_the_Forsaken") then ccR.Racial.Will_of_the_Forsaken() end		
			if (not ccR.Var("Use_OnBossOnly") or (ccR.Var("Use_OnBossOnly") and (ccR.Player.Is.Solo() or ccR.Target.Is.Boss()))) then
				if ccR.Player.Race() == "Orc" and ccR.Var("Use_Blood_Fury") then ccR.Racial.Blood_Fury() end
				if ccR.Player.Race() == "Troll" and ccR.Var("Use_Berserking") then ccR.Racial.Berserking() end
			end
		end
	end,
	Trinkets =
	function()
		if ccR.Player.Is.InCombat()
		and (ccR.Target.Is.Attackable() or ccR.Player.Is.Healer())
		and not ccR.Player.Is.CastingOrChanneling()
		and not IsStealthed()
		then
			if ccR.Target.Exists() then vTargetDistance = ccR.Target.Distance() end
			if ccR.Player.Is.Healer() or ((ccR.Player.Is.Melee() and vTargetDistance <= 12) or (ccR.Player.Is.Ranged() and vTargetDistance <= 44)) then
				if ccR.Var("Trinket_13")
				and (not ccR.Var("Trinket_13_OnlyOnBoss") or (ccR.Var("Trinket_13_OnlyOnBoss") and (ccR.Target.Is.Boss() or ccR.Player.Is.Solo())))
				then
					local startA, _, enableA = GetInventoryItemCooldown("player", 13)
					if enableA == 1 and startA == 0 then
						UseInventoryItem(13) 
						if SpellIsTargeting() and ccR.Target.Exists() then CastAtPosition(ObjectPosition("target")) end
						return
					end
				end
				if ccR.Var("Trinket_14")
				and (not ccR.Var("Trinket_14_OnlyOnBoss") or (ccR.Var("Trinket_14_OnlyOnBoss") and (ccR.Target.Is.Boss() or ccR.Player.Is.Solo())))
				then
					local startB, _, enableB = GetInventoryItemCooldown("player", 14)
					if enableB == 1 and startB == 0 then
						UseInventoryItem(14)
						if SpellIsTargeting() and ccR.Target.Exists() then CastAtPosition(ObjectPosition("target")) end
						return
					end
				end
			end
		end
	end,
}
setmetatable(ccR.Use, ccR)